package sort.数组测试;


import java.util.Arrays;

public class ArraysTest {

    public static void test1() {
        int[] arrays = {12,36,89,24,0,28,300,27,-9};
        Arrays.sort(arrays);
        for (int array : arrays) {
            System.out.println(array);
        }
        char[] chars = {'a','d','e','A','1'};
        Arrays.sort(chars);
        for (char aChar : chars) {
            System.out.println(aChar);
        }
    }

    public static void test2() {
        UserInfo userInfo1 = new UserInfo(16, "张三");
        UserInfo userInfo2 = new UserInfo(18, "李四");
        UserInfo userInfo3 = new UserInfo(13, "王五");
        UserInfo userInfo4 = new UserInfo(9, "小六");
        UserInfo[] arrays = {userInfo1,userInfo2,userInfo3,userInfo4};
        Arrays.sort(arrays);
    }
}
